#include <stdio.h>
void getline(char[]); /*function prototype*/
#define LSIZE 81

int main()
{
    char message[LSIZE]; /*enough storage for 80 characters plus '\0'*/

    printf("Enter a string: \n");
    getline(message);
    printf("The string just entered is: \n");
    puts(message);

    return 0;
}

void getline(char string[])
{
    int i = 0;
    char c;

    while (i < (LSIZE - 1) && (c = getchar()) != '\n')
    {
        string[i] = c; /*store the character entered*/
        i++;
    }
    string[i] = '\0'; /*terminate the string*/
}